Static Analysis To Improve Compiler Sanitization
نویسندگان
چکیده
Software security problems in inherently unsafe languages (C/C++) can be addressed by compiler tools that automatically insert checks that trap execution when exploitable faults are encountered at runtime. Such checks are seldom incorporated in production code because of the performance cost they impose, as the check injection to ensure safety is applied indiscriminately to every memory access. Our lab has developed static analysis methods to eliminate runtime checks that can be proven to be unnecessary. The benefit of this is to reduce overhead, improving security of running code at reasonable performance cost. In the current work we present results with benchmark programs that demonstrate the promise of this approach. Using the static analysis frameworks frama-C and CodeSurfer, variables value constraints and code dependency traces are converted to annotations inserted in the source code. Customized LLVM compiler passes incorporate these annotations into variable-attached metadata. During passes that insert runtime security checks, this metadata validates skipping check insertion in instances where the variable value has been proven to be safe. The LLVM compiler “safecode” pass which provides memory safety has so far proved only partially successful; improvements in this pass may manifest in the next iteration of our software. The LLVM compiler “integer overflow” pass exhibited excellent improvement in most of the benchmarks tested. In several benchmarks, over 80% of the runtime performance overhead due to these security checks was mitigated by our optimization protocol. Removal os “address sanitization” checks was also generally successful, delivering mitigation of more than 50% of the checks-imposed overhead for several benchmarks. The safety checks we studied can effectively elimnate vulnerabilities due to buffer overflow, integer overflow, and use-after-free scenarios. Our protocol greatly enhances the usability of these compiler-generated runtime protections.
منابع مشابه
Preventing SQL Injection through Automatic Query Sanitization with ASSIST
Web applications are becoming an essential part of our everyday lives. Many of our activities are dependent on the functionality and security of these applications. As the scale of these applications grows, injection vulnerabilities such as SQL injection are major security challenges for developers today. This paper presents the technique of automatic query sanitization to automatically remove ...
متن کاملPartiSan: Fast and Flexible Sanitization via Run-time Partitioning
Code sanitizers are used to automatically detect security vulnerabilities in C/C++ code that elude static analysis. This requires that the code paths containing the vulnerability are actually executed with sanitization enabled. Under current practice, sanitization is routinely applied when developers perform continuous integration testing and fuzzing of pre-release software. However, sanitizati...
متن کاملOptimal Sanitization Synthesis for Web Application Vulnerability Repair
We present a codeand input-sensitive sanitization synthesis approach for repairing string vulnerabilities that are common in web applications. The synthesized sanitization patch modifies the user input in an optimal way while guaranteeing that the repaired web application is not vulnerable. Given a web application, an input pattern and an attack pattern, we use automata-based static string anal...
متن کاملSimulation of Built-in PHP Features for Precise Static Code Analysis
The World Wide Web grew rapidly during the last decades and is used by millions of people every day for online shopping, banking, networking, and other activities. Many of these websites are developed with PHP, the most popular scripting language on the Web. However, PHP code is prone to different types of critical security vulnerabilities that can lead to data leakage, server compromise, or at...
متن کاملDynamic Compilation - I Lecture
With the modern software heavily utilizing shared libraries, dynamic class loading (for instance in Java) and runtime binding, the scope of static compiler analysis is becoming restrictive. The optimizations by the static compiler are limited by the information available at static compile time. Using profiling information may improve the accuracy of the information of run-time program behavior ...
متن کامل